import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

/**
 *
 * 给定n个字符串，请对n个字符串按照字典序排列。
 *
 *
 * @author: YuanChilde
 * @date: 2020-02-17 8:01
 * @version: 1.0
 * Modification History:
 * Date    Author      Version     Description
 * -----------------------------------------------------------------
 * 2020-02-17 8:01    YuanChilde     1.0        新增
 */
public class Demo17 {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        List<String> sort = new ArrayList(n);
        for(int i = 0; i<n; i++){
            sort.add(sc.next());
        }
        Collections.sort(sort);
        for(String a : sort){
            System.out.println(a);
        }
    }
}
